package peer.serverrdp;

import java.net.InetAddress;

public class ConnectionIdent {
	InetAddress dstIp;
	int dstPort;

	int hashCode;
	ConnectionIdent(InetAddress dstIp,int dstPort){
		
		this.dstIp=dstIp;
		this.dstPort=dstPort;
		hashCode=(dstIp.toString()+dstIp).hashCode();
	}
	
	@Override
	public int hashCode(){
		return hashCode;
	}
	
	@Override
	public boolean equals(Object ob){
		ConnectionIdent ci=(ConnectionIdent)ob;
		if(ob==null){
			return false;
		}else{
			return dstIp.equals(ci.dstIp)&dstPort==ci.dstPort;
		}
	}

}
